<?php

use App\Model\Device;
use App\Model\Site;
use App\Model\UserManageSite;
use Illuminate\Database\Seeder;

class EmulationSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //
        $site = new Site();
        $site->id = 10000;
        $site->user_id = 1;
        $site->name = '测试电站';
        $site->address = '测试电站——芯芸科技研发中心';
        $site->save();

        $user_manage_site = new UserManageSite();
        $user_manage_site->user_id = 1;
        $user_manage_site->owner_id = 1;
        $user_manage_site->site_id = 10000;
        $user_manage_site->save();

        $device_1 = new Device();
        $device_1->device_id = 10001;
        $device_1->name = '模拟设备1';
        $device_1->sn = '00-00-10001';
        $device_1->site_id = 10000;
        $device_1->user_id = 1;
        $device_1->group_id = -1;
        $device_1->save();

        $device_2 = new Device();
        $device_2->device_id = 10002;
        $device_2->name = '模拟设备2';
        $device_2->sn = '00-00-10002';
        $device_2->site_id = 10000;
        $device_2->user_id = 1;
        $device_2->group_id = -1;
        $device_2->save();

        $device_3 = new Device();
        $device_3->device_id = 10003;
        $device_3->name = '模拟设备3';
        $device_3->sn = '00-00-10003';
        $device_3->site_id = 10000;
        $device_3->user_id = 1;
        $device_3->group_id = -1;
        $device_3->save();

    }
}
